import QtQuick 2.0
import QtGraphicalEffects 1.12
import QtGraphicalEffects 1.12
Rectangle {
    id: lightBtn
    property int btnState: 0
    property int btnByte: 0
    property int currentBtnState: 0
    property bool pressState: false
    property string imageDefultSource
    property string imageLightSource
    property bool multiMode: false
    property bool greenMode: false
    signal btnClick()
    width: 160
    height: 160
    radius: 23
    color: btnByte ? "#2D8CFF" : "#1F2A37"
    border.width: 1
    border.color: "#10ADC9D9"
    layer.enabled: true
    layer.effect: DropShadow {
        horizontalOffset: 5
        verticalOffset: 5
        radius: 10
        color: "#F0000000"  // 半透明黑色
    }
    Rectangle{
        id: btnRect
        width: 96
        height: 8
        x:32
        y:16
        color: "#8BFF8B"
        visible:  false
    }
    Image{
        id: btnImg
        height: 96
        width: 96
        anchors.centerIn: parent
        source: imageDefultSource
        fillMode: Image.PreserveAspectFit
    }
    MouseArea{
        anchors.fill: parent
        onPressed: {
            // 可以在这里执行其他按下时的操作
            btnRect.visible = true
            lightBtn.pressState = true
        }
        onReleased: {
            // 可以在这里执行其他释放时的操作
            btnRect.visible = false
            lightBtn.pressState = false
        }
    }
}
